gotodetail = function(des, obj) {
	mui.openWindow({
		url: des,
		extras: {
			postid: $(obj).data("postid")
		}
	});
};

var time_sub,x_index='',x_text;
addlist = function(data,obj) {
		for(var key in data) {
			//if(key >= 9){
			//	x_index='';
			//}else{
			for(var pic_num = 0;pic_num<6;pic_num++){
				if(data[key].pic[pic_num] != null || data[key].pic[pic_num] != "" || data[key].pic[pic_num] != "null"){
					x_text='<img src="'+data[key].pic[pic_num]+'" alt="">';
					x_index+=x_text;
				}else{
					continue;
				}
			}
			////console.log(x_index);
			//}
//			alert(JSON.stringify(data))
			//时间截取
			time_sub = data[key].time.substring(0,16);
			var dom = '<li class="Tieba_list" onclick="gotodetail(\'sub_community_tieba_detail.html\',this)" data-postid="'+data[key].fakeid+'" class="mui-table-view-cell mui-media">' +
							'<a href="javascript:;">' +
								'<img id="listheadurl" class="mui-media-object mui-pull-left" src="'+data[key].headurl+'">' +
								'<div class="mui-media-body">' +
									'<h5 id="listwriter">'+data[key].username+'</h5>' +
									'<h4 id="listtitle">'+data[key].title+'</h4>' +
									//'<p id="summary" class="mui-ellipsis">'+data[key].summary+'</p>' +
									'<div class="mui_body_img">'+x_index+'</div>' +
									'<p><span id="time">'+time_sub+'</span><span id="discuss" class="mui-icon mui-icon-chatbubble mui-pull-right">'+data[key].commentcount+'</span></p>' +
								'</div>' +
							'</a>' +
						'</li>';
			$(obj).append(dom);
			x_index = ''; x_text='';
		}
}

img_html = function(){
	//'<img src="./images/60x60.gif" alt="">'
}

gotoerror = function(obj) {

		var dom = '<div style="text-align:center;margin-top:30px;color:grey;"> \
						帖子加载中...请下拉刷新\
					</div>';
		$(obj).append(dom);

}

